package com.haixiaoke.saas.contract.service.impl;

import java.util.List;

import com.haixiaoke.saas.common.utils.DateUtils;
import com.haixiaoke.saas.contract.domain.LesseeSource;
import com.haixiaoke.saas.contract.mapper.LesseeSourceMapper;
import com.haixiaoke.saas.contract.service.ILesseeSourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 租客来源Service业务层处理
 * 
 * @author panda
 * @date 2024-06-04
 */
@Service
public class LesseeSourceServiceImpl implements ILesseeSourceService {
    @Autowired
    private LesseeSourceMapper lesseeSourceMapper;

    /**
     * 查询租客来源
     * 
     * @param lesseeSourceId 租客来源主键
     * @return 租客来源
     */
    @Override
    public LesseeSource selectLesseeSourceByLesseeSourceId(Long lesseeSourceId) {
        return lesseeSourceMapper.selectLesseeSourceByLesseeSourceId(lesseeSourceId);
    }

    /**
     * 查询租客来源列表
     * 
     * @param lesseeSource 租客来源
     * @return 租客来源
     */
    @Override
    public List<LesseeSource> selectLesseeSourceList(LesseeSource lesseeSource) {
        return lesseeSourceMapper.selectLesseeSourceList(lesseeSource);
    }

    /**
     * 新增租客来源
     * 
     * @param lesseeSource 租客来源
     * @return 结果
     */
    @Override
    public int insertLesseeSource(LesseeSource lesseeSource) {
        lesseeSource.setCreateTime(DateUtils.getNowDate());
        return lesseeSourceMapper.insertLesseeSource(lesseeSource);
    }

    /**
     * 修改租客来源
     * 
     * @param lesseeSource 租客来源
     * @return 结果
     */
    @Override
    public int updateLesseeSource(LesseeSource lesseeSource) {
        lesseeSource.setUpdateTime(DateUtils.getNowDate());
        return lesseeSourceMapper.updateLesseeSource(lesseeSource);
    }

    /**
     * 批量删除租客来源
     * 
     * @param lesseeSourceIds 需要删除的租客来源主键
     * @return 结果
     */
    @Override
    public int deleteLesseeSourceByLesseeSourceIds(Long[] lesseeSourceIds) {
        return lesseeSourceMapper.deleteLesseeSourceByLesseeSourceIds(lesseeSourceIds);
    }

    @Override
    public int softDeleteLesseeSourceByLesseeSourceIds(Long[] lesseeSourceIds) {
        return lesseeSourceMapper.softDeleteLesseeSourceByLesseeSourceIds(lesseeSourceIds);
    }

    /**
     * 删除租客来源信息
     * 
     * @param lesseeSourceId 租客来源主键
     * @return 结果
     */
    @Override
    public int deleteLesseeSourceByLesseeSourceId(Long lesseeSourceId) {
        return lesseeSourceMapper.deleteLesseeSourceByLesseeSourceId(lesseeSourceId);
    }
}
